import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:share_fit/app/controllers/home/exercise_records/model/exercise_type.dart';
import 'package:share_fit/app/helper/ext/tr_ext.dart';
import 'package:share_fit/app/routes/sports_routes.dart';
import 'package:share_fit/generated/locales.g.dart';

class GoalSettingDialog extends Dialog {
  final int sportType;

  const GoalSettingDialog(this.sportType, {super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      alignment: Alignment.center,
      child: Container(
        decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(60.r)),
        padding: EdgeInsets.all(30.w),
        width: 800.w,
        height: 450.h,
        child: Material(
          child: Column(
            children: [
              Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [Text(LocaleKeys.info.ts)],
              ),
              Expanded(
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    Text(
                      LocaleKeys.sports_goal_set_dialog_text.ts,
                      style: TextStyle(fontSize: 62.sp),
                    )
                  ],
                ),
              ),
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceAround,
                children: [
                  GestureDetector(
                    onTap: () => Get.offAndToNamed(SportsRoutes.movementPage, arguments: {'name': ExerciseType(Type.getType(sportType), '')}),
                    child: Container(
                      alignment: Alignment.center,
                      width: 200.w,
                      child: Text(LocaleKeys.cancel.ts),
                    ),
                  ),

                  GestureDetector(
                    onTap: () => Get.offAndToNamed(SportsRoutes.goalSettingPage, arguments: sportType),
                    child: Container(
                      alignment: Alignment.center,
                      width: 200.w,
                      child: Text(LocaleKeys.ok.ts),
                    ),
                  ),
                ],
              )
            ],
          ),
        ),
      ),
    );
  }
}
